package com.java3y.sso.handler;

import com.java3y.sso.annotate.InfrawInputEqualsCheck;

import java.lang.annotation.Annotation;

public class InfrawInputEqualsCheckImpl implements InfrawInputHandler {

    @Override
    public void handle(Object o, Annotation filedAnnotation,String filedName, String ...str) throws Exception {

        for (String s : str) {
            if (filedAnnotation instanceof InfrawInputEqualsCheck){
                if (o==null || !o.equals(s)){
                    throw  new Exception(String.format("值不匹配%s",filedName));
                }

            }
        }

    }
}
